package com.iflytek.universitymanagement.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.iflytek.universitymanagement.domain.SurveyQuestion;
import com.iflytek.universitymanagement.domain.TopicSelect;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface SurveyQuestionMapper extends BaseMapper<SurveyQuestion> {

    static SurveyQuestion selectByTid(Integer tid) {
        return null;
    }

    @Select("SELECT * FROM topic_select WHERE tid = #{tid}")
    List<TopicSelect> getTopicSelectByTid(@Param("tid") Integer tid);

    @Insert("INSERT INTO survey_question (description, Type, Sort) VALUES (#{description}, #{Type}, #{Sort})")
    void insertSurveyQuestion(SurveyQuestion surveyQuestion);
}
